<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="shortcut icon" href="./images/favicon.ico">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>-*锋行天下音乐*-</title>
  <style>
    body{
      margin: 0;
    }
    video{
      width: 100vw;
    }
    .a-wrap{
      width: 100%;
      line-height: 50px;
      text-align: center;
    }
  </style>
  <script src="./js/axios.js"></script>
</head>
<body>
  <video id="video" src="" autoplay controls="controls">
    您的浏览器不支持 video 标签。
  </video>
  <div class="a-wrap">
    <a href="http://w.liyefeng.top" target="_blank">返回首页</a>
  </div>
</body>
<script>
  function decodeFromBase64(str) {
    return decodeURIComponent(Array.prototype.map.call(atob(str), function(c) {
        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
    }).join(''));
  }

  window.onload=()=>{
    let video=document.getElementById('video')
    // let url=JSON.parse(sessionStorage.getItem('videoSrc'))
    let s=window.location.search.split('?')[1]
    let src=s.split('=')[1]
    let url=decodeFromBase64(src)
    video.src=url
    //提交游客记录
    let str=navigator.userAgent.toLocaleLowerCase()
      let strArr=str.split(" ")
      let last1=strArr[strArr.length-1]
      let last2=strArr[strArr.length-2]
      let ua=`${last2}-${last1}`
    axios.get(`/shopApi/addTourist?scene=music|videoPlay&message=${ua}`).then(res => {
      if(res.status==200){
        console.log("ok")
      }
    })
  }
</script>
</html>